<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var money = 100;

			while (true) {
				var num = prompt('1存钱 \n 2取钱 \n 3显示余额 \n 4退出');
				switch (parseInt(num)) {
					case 1:
						var num2 = prompt('存多少');
						money = money + parseFloat(num2);
						alert('余额为' + money);
						break;
					case 2:
						var num3 = prompt('取多少');
						money = money - num3;
						alert('余额为' + money);
						break;
					case 3:
						alert('余额为' + money);
						break;
					
				}
				if (parseInt(num) == 4) {
					break;
				}
			}
		</script>
	</head>
	<body>
	</body>
</html>
